import React, { useState } from 'react'
import FastLogin from './FastLogin'
import InputLogin from './InputLogin'

const Login = () => {
  // 控制快捷登录或输入框登录
  const [loginType, setLoginType] = useState<'fast' | 'input'>('fast')

  // 切换登录类型的回调
  const onChangeLoginType = (type: typeof loginType) => {
    setLoginType(type)
  }
  return (
    <>
      {loginType === 'fast' ? (
        <FastLogin onChangeLoginType={onChangeLoginType}></FastLogin>
      ) : (
        <InputLogin onChangeLoginType={onChangeLoginType}></InputLogin>
      )}
    </>
  )
}

export default Login
